package com.ruoyi.production.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.apache.poi.ss.usermodel.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.production.mapper.OrdersMapper;
import com.ruoyi.production.domain.Orders;
import com.ruoyi.production.service.IOrdersService;

/**
 * 生产工单Service业务层处理
 * 
 * @author admin
 * @date 2024-08-02
 */
@Service
public class OrdersServiceImpl implements IOrdersService 
{
    @Autowired
    private OrdersMapper ordersMapper;

    /**
     * 查询生产工单
     * 
     * @param ordersId 生产工单主键
     * @return 生产工单
     */
    @Override
    public Orders selectOrdersByOrdersId(Long ordersId)
    {
        return ordersMapper.selectOrdersByOrdersId(ordersId);
    }

    /**
     * 查询生产工单列表
     * 
     * @param orders 生产工单
     * @return 生产工单
     */
    @Override
    public List<Orders> selectOrdersList(Orders orders)
    {
        return ordersMapper.selectOrdersList(orders);
    }

    /**
     * 新增生产工单
     * 
     * @param orders 生产工单
     * @return 结果
     */
    @Override
    public int insertOrders(Orders orders)
    {orders.setCreateTime(DateUtils.getNowDate());
        return ordersMapper.insertOrders(orders);
    }

    /**
     * 修改生产工单
     * 
     * @param orders 生产工单
     * @return 结果
     */
    @Override
    public int updateOrders(Orders orders)
    {
        return ordersMapper.updateOrders(orders);
    }

    /**
     * 批量删除生产工单
     * 
     * @param ordersIds 需要删除的生产工单主键
     * @return 结果
     */
    @Override
    public int deleteOrdersByOrdersIds(Long[] ordersIds)
    {
        return ordersMapper.deleteOrdersByOrdersIds(ordersIds);
    }

    /**
     * 删除生产工单信息
     * 
     * @param ordersId 生产工单主键
     * @return 结果
     */
    @Override
    public int deleteOrdersByOrdersId(Long ordersId)
    {
        return ordersMapper.deleteOrdersByOrdersId(ordersId);
    }
}
